package com.ptu.spzx.manager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ptu.spzx.model.entity.system.SysCourseUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseUserMapper extends BaseMapper<SysCourseUser> {
    @Delete("DELETE FROM sys_course_user WHERE belong_course_id=#{courseId}")
    void deleteCourseUser(Long curseId);

    @Select("SELECT belong_course_id from sys_course_user WHERE user_id=#{teachId}")
    List<Long> selectCourseIdByteachId(Long teachId);

    @Select("SELECT user_id from sys_course_user WHERE belong_course_id=#{courseId}")
    List<Long> selectTeacherIdByCourseId(Long courseId);
}
